<?php

namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers;
use Request,Validator;
class TestController extends Controller
{
    public function create()
    {
        $rq = Request::all();
        $validator = Validator::make($rq,[
            'name' => 'required|between:4,6|unique:users',//
            'age' => 'required|numeric'
        ]);

        if($validator->fails())
        {
            return $validator->errors();
        }
        echo '验证成功';
        return $rq;
    }
}
